home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga CD-ROM Collection
/
Amiga CD-ROM Collection - Auge 4000 and Cactus and Demo Util.iso
/
auge4000
/
46
/
lib
/
fd
/
getfh.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-20
|
382b
|
31 lines
/*
* GETFH.C
*
* (c)Copyright 1990, Matthew Dillon, All Rights Reserved
*/
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
_IOFDS *
__getfh(fd)
short fd;
{
_IOFDS *d;
if ((unsigned)fd >= _IoFDLimit) {
errno = EBADF;
return(NULL);
}
d = _IoFD + fd;
if ((d->fd_Flags & O_ISOPEN) == 0) {
errno = EBADF;
return(NULL);
}
return(d);
}